from paddleocr import PaddleOCR, draw_ocr
from deoldify import device
from deoldify.device_id import DeviceId
import torch
import fastai

def testPaddleOcr(name):
    ocr = PaddleOCR(use_angle_cls=True, use_gpu=False)
    result = ocr.ocr(name, cls=True)
    for line in result:
        print(line)

def testColor(name):
    # choice cpu,gpu0..gpu7
    device.set(device=DeviceId.GPU0)
    if not torch.cuda.is_available():
        print('GPU not available')
    print(name)

if __name__ == '__main__':
    #testPaddleOcr('F:/Image/ocr/组合 1_页面_18.jpg')
    #testColor('F:/Image/ocr/组合 1_页面_18.jpg')
    info = '@@{1111111111111111}@@'
    print(info[:2])
    print(info[-2:])
    print(info[2:-2])

